package com.zyf.ui;

import com.zyf.entity.window;
import com.zyf.service.serviceImpl.serviceImpl;

public class mianUi {

    public static void main(String[] args) {
        window win = new window();
        serviceImpl si = new serviceImpl();

//        String table = "";
//        String username = "";
//        String password = "";
//
//        win.showTitle();
//        System.out.println("--------请先登录--------");
//        System.out.println("请输入用户名:");
//        username = win.getString(win.input);
//        System.out.println("请输入密码:");
//        password = win.getString(win.input);
//        System.out.println("请输入数据表:");
//        table = win.getString(win.input);
//
//

        int exitFlag = -1;
        int fail = -1;
        while (exitFlag < 0) {
            if (fail > 0) {
                System.out.println("请重新输入:");
                fail = -1;
            }
            win.showTitle();
            int levelOne = win.showMenu();
            switch (levelOne) {
                case 1:
                    win.listAllBook();
                    break;
                case 2:
                    win.findByName();
                    break;
                case 3:
                    win.findByAuther();
                    break;
                case 4:
                    win.findByLocation();
                    break;
                case 5:
                    win.newBook();
                    break;
                case 6:
                    win.deleteBook();
                    break;
                case 7:
                    win.changeInfo();
                    break;
                case 0:
                    exitFlag = 1;
                    System.out.println("再见");
                    break;
                default:
                    fail = 1;
            }


        }


    }

}
